If ObjectProperty(Object_ID('dbo.opengiving_map_contactUserIDInsert_sp'), N'IsProcedure') Is Null
Begin
    Execute ('Create Procedure dbo.opengiving_map_contactUserIDInsert_sp As Print ''Hello World!''')
    RaisError('Procedure opengiving_map_contactUserIDInsert_sp created.', 10, 1);
End;
Go

Set ANSI_Nulls On;
Set Quoted_Identifier On;
Go

Alter Procedure dbo.opengiving_map_contactUserIDInsert_sp

        /* Declare Parameters */
          @userID   uniqueidentifier
As
/*********************************************************************************
    Name:       opengiving_map_contactUserIDInsert_sp

    Author:     Michelle Ufford

    Purpose:    Inserts a record into the opengiving_map_contactUserID table.

    Notes:      Part of the OpenGiving open-source project, 
                http://opengiving.codeplex.com

    Called by:  admin tool

    Date        User    Description
    ----------------------------------------------------------------------------
    2009-05-05  MFU     Initial Release
*********************************************************************************
    Exec dbo.opengiving_map_contactUserIDInsert_sp
          @userID = '00000000-0000-0000-0000-000000000000';
*********************************************************************************/

Set NoCount On;
Set XACT_Abort On;
Set Ansi_Padding On;
Set Ansi_Warnings On;
Set ArithAbort On;
Set Concat_Null_Yields_Null On;
Set Numeric_RoundAbort Off;

Begin
    Begin Try
   
        /* Start a new transaction */
        Begin Transaction;

        Insert Into dbo.opengiving_map_contactUserID
        (
            userID
        )
        OutPut inserted.contact_id
        Values
        (
            @userID
        );

        /* If you have an open transaction, commit it */
        If @@TranCount > 0
            Commit Transaction;

    End Try
    Begin Catch

        /* Whoops, there was an error... rollback! */
        If @@TranCount > 0
            Rollback Transaction;

        /* Return an error message and log it */
        Execute dbo.dba_logError_sp;

    End Catch;

    Set NoCount Off;
    Return 0;
End
Go

Set Quoted_Identifier Off;
Go